/******************************************************************************
/// @brief
/// @copyright Copyright (c) 2017 <dji-innovations, Corp. RM Dept.>
/// @license MIT License
/// Permission is hereby granted, free of charge, to any person obtaining a copy
/// of this software and associated documentation files (the "Software"), to deal
/// in the Software without restriction,including without limitation the rights
/// to use, copy, modify, merge, publish, distribute, sublicense,and/or sell
/// copies of the Software, and to permit persons to whom the Software is furnished
/// to do so,subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in
/// all copies or substantial portions of the Software.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
/// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
/// THE SOFTWARE.
*******************************************************************************/

#ifndef _MPU_H_
#define _MPU_H_

//#include "my_math.h"
#include "mytype.h"

typedef struct
{
    s16 ax;
    s16 ay;
    s16 az;

    s16 mx;
    s16 my;
    s16 mz;

    s16 temp;

    s16 gx;
    s16 gy;
    s16 gz;

} MPU_OriginData;

typedef struct
{
    s16 ax;
    s16 ay;
    s16 az;

    s16 mx;
    s16 my;
    s16 mz;

    float temp;

    float wx; //omiga, +- 2000dps => +-32768  so gx/16.384/57.3 =	rad/s
    float wy;
    float wz;

    float rol;
    float pit;
    float yaw;
} imu_t;

u8                    mpu_device_init(void);
void                  mpu_get_data(void);
extern MPU_OriginData mpu_data;
extern imu_t          imu;

#endif
